package com.cskaoyan.controller.wx;

import com.cskaoyan.model.admin.vo.BaseData;
import com.cskaoyan.model.admin.vo.BaseDataListVo;
import com.cskaoyan.model.admin.vo.BaseRespVo;
import com.cskaoyan.model.vx.vo.WxTopicVo;
import com.cskaoyan.service.wx.WxTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hanshuai
 * @version 1.0
 * @description @TODO
 * @date 2021/12/2 10:59
 */
@RestController
@RequestMapping("/wx/topic")
public class WxTopicController {
    @Autowired
    WxTopicService wxTopicService;

    @RequestMapping("/related")
    public BaseRespVo topicRelated(Integer id) {
        BaseData baseData = wxTopicService.topicRelated(id);
        return BaseRespVo.ok(baseData);
    }

    @RequestMapping("/detail")
    public BaseRespVo topicDetail(Integer id) {
        WxTopicVo wxTopicVo = wxTopicService.topicDetail(id);
        return BaseRespVo.ok(wxTopicVo);
    }

    @RequestMapping("/list")
    public BaseRespVo topicList(Integer page, Integer limit) {
        BaseDataListVo baseDataListVo = wxTopicService.topicList(page, limit);
        return BaseRespVo.ok(baseDataListVo);
    }
}
